<?php
/**
 * @version      BOSSCMS-Free
 * @trademark    BOSSCMS
 * @copyright    Copyright © by BOSSCMS-Free (https://www.bosscms.net/) 保留所有权利
 * @license      https://gitee.com/Greenpeas/BOSSCMS/license/ 和 https://www.bosscms.net/freelicense/
 * @link         https://www.bosscms.net/
 * @author       温州软界网络技术有限公司
**/
defined('IS_OK') or exit('Access Forbidden');
$type = $G['get']['type'];
?>
<?php load::into('head'); ?>
<?php echo $G['navsub']; ?>
<form action="<?php echo url::mpf('layers','layers','modify'); ?>" method="post" enctype="multipart/form-data">
<section class="main table tree" tree="layer<?php echo $G['get']['core']; ?>stable" cookie="layers<?php echo $G['get']['core']; ?>TableTr">
  <aside>
    <div>
      <?php if(arrExist($G['get'],'series')){ ?>
      <div class="head">
        <a class="button green" easy url="<?php echo url::mpf('layers','layers','edit',array('series'=>$G['get']['series'])); ?>">
          <em class="fa fa-plus"></em>
          <font>添加内容</font>
        </a>
      </div>
      <?php } ?>
      <table>
        <tbody>
          <tr>
            <th>选择</th>
            <th width="58">排序</th>
            <th>模块 / 标题</th>
            <th width="88">显示</th> 
            <th>操作</th>
          </tr>
          <?php
		  $parent = 0;
          foreach($data as $v){
		  if(isset($v['ctrl'])){
          ?>
          <tr level="<?php echo $v['level']; ?>" it="<?php echo $parent.'000'; ?>">
            <td width="48"><?php echo form::checkbox(null,null,null,array(null)); ?></td>
            <td></td>
            <td lv colspan="2"><?php echo $v['title']; ?></td>
            <td width="155">
              <a class="button green tfa" easy url="<?php echo url::mpf('layers','layers','edit',array('series'=>$v['id'],'parent'=>$v['parent']?$parent:null)); ?>">
                <em class="fa fa-plus"></em>
                <font>添加内容</font>
              </a>
            </td>
          </tr>
          <?php
		  }else{
		  $parent = $v['id'];
          ?>
          <tr level="<?php echo $v['level']; ?>" it="<?php echo $v['id']; ?>">
            <td width="48"><?php echo form::checkbox('id',null,null,array($v['id']=>null)); ?></td>
            <td width="58"><?php echo form::input("sort{$v['id']}",$v['sort'],null,'text',null); ?></td>
            <td lv><?php echo $v['name']; ?></td>
            <td width="88"><?php echo form::radio("display{$v['id']}",$v['display'],1,$G['option']['is'],array('color'=>'green','post'=>'{"id[]":"'.$v['id'].'"}','url'=>url::mpf('layers','layers','modify'))); ?></td>
            <td width="155">
              <a class="btnfa black" name="修改内容" easy url="<?php echo url::mpf('layers','layers','edit',array('id'=>$v['id'],'series'=>$v['series'])); ?>">
                <em class="fa fa-pencil" title="修改"></em>
              </a>
              <a class="btnfa red delete" url="<?php echo url::mpf('layers','layers','delete',array('id'=>$v['id'])); ?>">
                <em class="fa fa-trash-o" title="删除"></em>
              </a>
            </td>
          </tr>
          <?php
          }
		  }
          ?>
        </tbody>
      </table>
    </div>
  </aside>
</section>    
<section class="refer" <?php echo $G['body_class']=='iframe-content'?(is_numeric($_COOKIE['iframeContentX'])?'style="margin-left:'.$_COOKIE['iframeContentX'].'px;"':'contentx'):''; ?>>
  <a class="button green checkall">
    <em class="fa fa-square"></em>
    <font>全选</font>
  </a>
  <a class="button green tfa nocheckall">
    <em class="fa fa-square-o"></em>
    <font>取消</font>
  </a>
  <button class="button green" type="submit">
    <em class="fa fa-floppy-o"></em>
    <font>提交</font>
  </button>
  <a class="button red tfa delcheck" url="<?php echo url::mpf('layers','layers','delete'); ?>">
    <em class="fa fa-trash-o"></em>
    <font>删除</font>
  </a>
</section> 
</form>
<?php load::into('foot'); ?>